import styles from './index.module.scss'
interface Props {
  hideList: (type: 'gender' | 'photo') => void
  type: 'gender' | 'photo'
  onUpdate: (type: 'gender' | 'photo', value: string) => void
}
export default function EditList({ hideList, type, onUpdate }: Props) {
  return (
    <>
      <div className={styles.root}>
        {type === 'gender' ? (
          <>
            <div className="list-item" onClick={() => onUpdate('gender', '0')}>
              男
            </div>
            <div className="list-item" onClick={() => onUpdate('gender', '1')}>
              女
            </div>
          </>
        ) : (
          <>
            <div className="list-item">拍照</div>
            <div className="list-item" onClick={() => onUpdate('photo', '')}>
              本地选择
            </div>
          </>
        )}
        <div className="list-item" onClick={() => hideList(type)}>
          取消
        </div>
      </div>
    </>
  )
}
